import request from '@/utils/request'

// 查询数字权益卡列表列表
export function listEquityCard(query) {
  return request({
    url: '/equityManager/equityCard/list',
    method: 'get',
    params: query
  })
}
// 权益门店选择列表
export function shopList(query) {
  return request({
    url: '/equityManager/equityCard/shop/list',
    method: 'get',
    params: query
  })
}
// 获取数字权益卡门店设置列表
export function equityCardShopSetup(query) {
  return request({
    url: '/equityManager/equityCard/shop/setup',
    method: 'get',
    params: query
  })
}
// 转换门店设置为列表格式
export function changeSetup(data) {
  return request({
    url: '/equityManager/equityCard/change/setup',
    method: 'post',
    data: data,
  })
}
// 获取数字权益卡门店权益列表
export function cardShopList(query) {
  return request({
    url: '/equityManager/equityCard/cardShopList',
    method: 'get',
    params: query
  })
}
// 获取发行方列表
export function issuerSelectList(query) {
  return request({
    url: '/equityManager/issuer/select/list',
    method: 'get',
    params: query
  })
}

// 新增数字权益卡列表
export function addEquityCard(data) {
  return request({
    url: '/equityManager/equityCard',
    method: 'post',
    data: data
  })
}
// 获取数字权益卡详细信息
export function getEquityCard(id) {
  return request({
    url: '/equityManager/equityCard/' + id,
    method: 'get'
  })
}
// 修改数字权益卡列表
export function updateEquityCard(data) {
  return request({
    url: '/equityManager/equityCard',
    method: 'put',
    data: data
  })
}
// 更新权益合约
export function updateEquityCardSetup(data) {
  return request({
    url: '/equityManager/equityCard/setup/update',
    method: 'put',
    data: data
  })
}
// 持卡会员统计
export function customerCount(query) {
  return request({
    url: '/equityManager/equityCard/customer/count',
    method: 'get',
    params: query
  })
}
// 持卡会员列表
export function customerList(query) {
  return request({
    url: '/equityManager/equityCard/customer/list',
    method: 'get',
    params: query
  })
}

// 导出数字权益卡门店权益列表
export function exportEquityCard(query) {
  return request({
    url: '/equityManager/equityCard/shop/export',
    method: 'get',
    params: query
  })
}
// 权益库存选择列表
export function inventorySelectLs(query) {
  return request({
    url: '/equity/inventory/select/list',
    method: 'get',
    params: query
  })
}
// 查询权益发放
export function inventoryIssue(id) {
  return request({
    url: '/equityManager/equityCard/inventory/issue/' + id,
    method: 'get',
  })
}
// 保存权益发放
export function inventoryIssueSave(data) {
  return request({
    url: '/equityManager/equityCard/inventory/issue/save',
    method: 'put',
    data: data
  })
}
// 停用权益发放
export function inventoryIssueStop(data) {
  return request({
    url: '/equityManager/equityCard/inventory/issue/stop',
    method: 'put',
    data: data
  })
}
// 持卡明细列表
export function customerCardLs(query) {
  return request({
    url: '/equityManager/equityCard/customer/card/list',
    method: 'get',
    params: query
  })
}
// 历史激活权益列表
export function historyEquityLs(query) {
  return request({
    url: '/equityManager/equityCard/customer/history/equity/list',
    method: 'get',
    params: query
  })
}
// 历史配置权益列表
export function inventoryIssueLs(query) {
  return request({
    url: '/equityManager/equityCard/inventory/issue/list',
    method: 'get',
    params: query
  })
}
// 历史配置权益明细列表
export function inventoryIssueDetailLs(query) {
  return request({
    url: '/equityManager/equityCard/inventory/issue/detail/list',
    method: 'get',
    params: query
  })
}
// 权益id分配列表
export function inventoryList(query) {
  return request({
    url: '/equityManager/inventory/list',
    method: 'get',
    params: query
  })
}
// 发行库存调整
export function inventoryIssueUpdate(data) {
  return request({
    url: '/equityManager/inventory/issue/update',
    method: 'put',
    data: data
  })
}
// 盲盒库存调整
export function inventoryBoxUpdate(data) {
  return request({
    url: '/equityManager/inventory/box/update',
    method: 'put',
    data: data
  })
}
// 兑换库存调整
export function inventoryChangeUpdate(data) {
  return request({
    url: '/equityManager/inventory/change/update',
    method: 'put',
    data: data
  })
}
// 查询自定义标签下拉框
export function tagSelect(query) {
  return request({
    url: '/equityManager/equityCard/tag/select',
    method: 'get',
    params: query
  })
}
// 2023-1-4
//保存导入数字权益卡
export function equityCardSaveImport(data) {
  return request({
    url: '/equityManager/equityCard/save/import',
    method: 'post',
    data: data
  })
}
// 批量发行库存调整
export function inventoryIssueUpdateBatch(data) {
  return request({
    url: '/equityManager/inventory/issue/update/batch',
    method: 'put',
    data: data
  })
}
// 批量盲盒库存调整
export function inventoryBoxUpdateBatch(data) {
  return request({
    url: '/equityManager/inventory/box/update/batch',
    method: 'put',
    data: data
  })
}
// 批量兑换库存调整
export function inventoryChangeUpdateBatch(data) {
  return request({
    url: '/equityManager/inventory/change/update/batch',
    method: 'put',
    data: data
  })
}
// 批量合成库存调整
export function inventoryCastingUpdateBatch(data) {
  return request({
    url: '/equityManager/inventory/casting/update/batch',
    method: 'put',
    data: data
  })
}

//批量数字宝箱库存调整
export function inventoryTreasureBatch(data) {
  return request({
    url: '/equityManager/inventory/treasure/box/update/batch',
    method: 'put',
    data: data
  })
}
//2023-5-18
// 查询通用权益库存下拉框
export function currentInventorySelect(query) {
  return request({
      url: `/common/v1/equity/inventory/select`,
      method: 'get',
      params:query
  })
}